﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class VIPUDragView : EventTrigger {

    private VIPScrollView vipScrollView;
    public void SetScrollView(VIPScrollView view)
    {
        vipScrollView = view;
    }

    public override void OnBeginDrag(PointerEventData eventData)
    {
        base.OnBeginDrag(eventData);
    }

    public override void OnDrag(PointerEventData eventData)
    {
        base.OnDrag(eventData);
        if (vipScrollView != null)
            vipScrollView.OnDragEnhanceViewMove(eventData.delta);
    }

    public override void OnEndDrag(PointerEventData eventData)
    {
        base.OnEndDrag(eventData);
        if (vipScrollView != null)
            vipScrollView.OnDragEnhanceViewEnd();
    }

}
